<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Aworks extends Controller_Abase_Adefaultactions {

    public function action_delete() {
        $params = $this->params();
        $this->obj = ORM::factory($this->request->controller(), $this->request->param('id'));

        if (is_file($params['fields']['image']['image_params']['dir'].$this->obj->image)) {
            unlink($params['fields']['image']['image_params']['dir'].$this->obj->image);
        }

        parent::action_delete();
    }

}